home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Professor Multimedia
/
Professor Multimedia.iso
/
stup
/
specific.inc
< prev
Wrap
Text File
|
1993-12-09
|
8KB
|
245 lines
''--------------------------------------------------------------------
'' Professor MULTIMEDIA CD-specific install functions
'' Copyright (c) 1993 Individual Software, Inc.
''--------------------------------------------------------------------
'' Set up product-specific titles, etc.
SUB SetProductTitles STATIC
SetTitle "Professor MULTIMEDIA" ''Setup Window Title
PMMAPP$ = "Professor MULTIMEDIA" ''Text under the icon
END SUB
FUNCTION InfFile() STATIC AS STRING
InfFile = "PMM.INF"
END FUNCTION
FUNCTION MakeInstDir(D$) STATIC AS STRING
'' If we're lucky, this will tell us where we're located
S$ = GetIniKeyString(WININI$, "ProfMultiMedia", "PMM")
'' If that didn't work, then try this for 2.02
IF S$ = "" THEN
S$ = GetIniKeyString(WININI$, "Sound API", "MaleVoice")
S$ = mid$(S$, 1, len(S$) - len("\VOICE3.VOI"))
END IF
'' If that didn't work, then we'll punt with the default
IF S$ = "" THEN
S$ = D$ + ":\PMM"
END IF
'' Homing file found (PMM.EXE, but could be file in destination dir)
IF EXISTS(MakePath(S$, "PMM.EXE")) THEN
r% = DoMsgBox("An installed copy of Professor MULTIMEDIA was found in " + S$+ ".", "Professor MULTIMEDIA", MB_OK)
END IF
MakeInstDir = S$
END FUNCTION
SUB AddInfSectionNames(BASE$, SOUNDS$, BASEINST$, SOUNDSINST$) STATIC
'' These are the base files we can install
AddListItem BASE$, "Base Files"
SetSymbolValue BASEINST$, GetSymbolValue(BASE$)
'' By default, we install all the above
'' SetSymbolValue SOUNDSINST$, GetSymbolValue(SOUNDS$)
'' The user probably doesn't want all these on the HD by default
'' AddListItem SOUNDS$, "Video Samples"
END SUB
SUB RecalcPath STATIC
CursorSave% = ShowWaitCursor()
RecalcOptFiles BASEFILES
RecalcOptFiles SOUNDFILES
RestoreCursor CursorSave%
END SUB
SUB AddOptFiles STATIC
AddOptFilesToCopyList BASEFILES
AddOptFilesToCopyList SOUNDFILES
END SUB
SUB AddOptFilesToCopyList (ftype%) STATIC
IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
SrcDir$ = GetSymbolValue("STF_SRCDIR")
IF ftype% = BASEFILES THEN
''Base files
l% = GetListLength(BASEINST$)
FOR i% = 1 TO l% STEP 1
AddSectionFilesToCopyList GetListItem(BASEINST$, i%), SrcDir$, DEST$
NEXT i%
AddSectionFilesToCopyList "ToolBook", SrcDir$, DEST$
'' Install Video for Windows runtime
AddSectionFilesToCopyList "Media Player", MakePath(SrcDir$, "STUP\VFW"), WINDIR$
AddSectionFilesToCopyList "VFW Runtime", MakePath(SrcDir$, "STUP\VFW"), SYSDIR$
AddSectionFilesToCopyList "Codecs", MakePath(SrcDir$, "STUP\VFW"), WINDIR$
AddSectionFilesToCopyList "Cinepak Codec", MakePath(SrcDir$,"STUP\VFW"), SYSDIR$
''--ELSEIF ftype% = SOUNDFILES THEN
'' l% = GetListLength(SOUNDSINST$)
'' FOR i% = 1 TO l% STEP 1
'' AddSectionFilesToCopyList GetListItem(SOUNDSINST$, i%), SrcDir$, DEST$
''----- NEXT i%
END IF
SrcDir$ = ""
END IF
END SUB
SUB SetDriveStatus STATIC
FITS% = 0
drive$ = MID$(DEST$, 1, 1)
ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
cost& = VAL(GetListItem(BASENEEDS$, ndrive%))
cost& = cost& + VAL(GetListItem(SOUNDNEEDS$, ndrive%))
free& = GetFreeSpaceForDrive(drive$)
IF cost& > free& THEN
FITS% = 1
END IF
ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
'' IF drive$ = WINDRIVE$ THEN
'' ReplaceListItem DRIVETEXT$, 4, ""
'' ReplaceListItem DRIVETEXT$, 5, ""
'' ReplaceListItem DRIVETEXT$, 6, ""
'' ELSE
'' ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
'' cost& = VAL(GetListItem(BASENEEDS$, ndrive%))
'' cost& = cost& + VAL(GetListItem(SOUNDNEEDS$, ndrive%))
'' IF cost& = 0 THEN
'' ReplaceListItem DRIVETEXT$, 4, ""
'' ReplaceListItem DRIVETEXT$, 5, ""
'' ReplaceListItem DRIVETEXT$, 6, ""
'' ELSE
'' free& = GetFreeSpaceForDrive(WINDRIVE$)
'' IF cost& > free& THEN
'' FITS% = 1
'' END IF
'' ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
'' ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
'' ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
'' END IF
'' END IF
END SUB
'' Add billboard dialogs for this app
SUB AddBillboards STATIC
AddToBillboardList CUIDLL$, BBD1, "FModelessDlgProc", 100
AddToBillboardList CUIDLL$, BBD6, "FModelessDlgProc", 100
END SUB
SUB ConfigureApps STATIC
'' This is so Fixer can find where we're installed
CreateIniKeyValue WININI$, "ProfMultiMedia", "PMM", DEST$, cmoOverwrite
'' This is the name of the group we'll install into
GROUP$ = "Professor MULTIMEDIA"
'' Configure base applications
IF GetListItem(CHECKSTATES$, BASEFILES) = "ON" THEN
MakeGroup:
'' Create a group for us...
CreateProgmanGroup GROUP$, "", cmoNone
'' Setup PMM Program
''--CreateProgmanItem GROUP$, PMMAPP$, MakePath(DEST$,"tbook.exe")+" "+CDDRV$+"mainmenu.tbk", MakePath(DEST$,"PMM.ICO"), cmoOverwrite
CreateProgmanItem GROUP$, PMMAPP$, MakePath(DEST$,"PMM.EXE"),"" , cmoOverwrite
'' Disable Win 3.1 system startup and exit sounds
s$ = GetIniKeyString(WININI$, "Sounds", "SystemStart")
CreateIniKeyValue WININI$, "Sounds", "OldSystemStart", s$, cmoOverwrite
CreateIniKeyValue WININI$, "Sounds", "SystemStart", "<none>,System Start", cmoOverwrite
s$ = GetIniKeyString(INI$, "Sounds", "SystemExit")
CreateIniKeyValue WININI$, "Sounds", "OldSystemExit", s$, cmoOverwrite
CreateIniKeyValue WININI$, "Sounds", "SystemExit", "<none>,System Exit", cmoOverwrite
'' Setup Video for Windows
CreateIniKeyValue SYSINI$, "Drivers", "VIDC.MSVC", "msvidc.drv", cmoNone
CreateIniKeyValue SYSINI$, "Drivers", "VIDC.RT21", "indeo.drv", cmoNone
CreateIniKeyValue SYSINI$, "mci", "AVIVideo", "mciavi.drv", cmoNone
CreateIniKeyValue WININI$, "mci extensions", "avi", "AVIVideo", cmoNone
''------------------------------------------------------CinePak
'This routine should be run whether or not the files are copied.
'This is because the existence of the files on disk is not a
'guarantee of correct installation!
'Updating CONTROL.INI and SYSTEM.INI
CreateIniKeyValue GetWindowsDir() + "control.ini", "Userinstallable.drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "control.ini", "related.desc", "VIDC.CVID", "", cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
''------------------------------------------------------
'' Hack because the MIDI files have goofs in them...
CreateIniKeyValue SYSINI$, "mciseq.drv", "disablewarning", "true", cmoNone
res% = Run("regedit.exe /s " + MakePath(WINDIR$, "mplayer.reg"))
'' res% = Run("profdisp.exe")
END IF
END SUB
'' Remove all files and directories...
SUB DoUninstall STATIC
'' res% = sndPlaySound(MakePath(INSTSNDDIR$, "v13.wav"), 3)
IF IDYES = DoMsgBox("Are you sure you want to remove Professor MULTIMEDIA from your system?", "Professor MULTIMEDIA ", MB_YESNO) THEN
DEST$ = GetIniKeyString(WININI$, "ProfMultiMedia", "PMM")
IF DEST$ <> "" THEN
old% = ShowWaitCursor()
RemDirectory DEST$
RemoveIniSection WININI$, "Sound API", cmoNone
'' Reset default startup and exit sounds
s$ = GetIniKeyString(WININI$, "Sounds", "OldSystemStart")
RemoveIniKey WININI$, "Sounds", "OldSystemStart", cmoNone
CreateIniKeyValue WININI$, "Sounds", "SystemStart", s$, cmoOverwrite
s$ = GetIniKeyString(WININI$, "Sounds", "OldSystemExit")
RemoveIniKey WININI$, "Sounds", "OldSystemExit", cmoNone
CreateIniKeyValue WININI$, "Sounds", "SystemExit", s$, cmoOverwrite
RestoreCursor old%
i% = DoMsgBox("Professor MULTIMEDIA has been removed. You can run Setup later to re-install it.", "Professor MULTIMEDIA", MB_OK)
END
ELSE
i% = DoMsgBox("Professor MULTIMEDIA is not installed or cannot be found!", "Professor MULTIMEDIA", MB_OK)
END IF
END IF
END SUB